<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
  <title>新增周边游-库存</title>
  <link rel="stylesheet" href="../../css/bootstrap.font.min.css"/>
  <link rel="stylesheet" href="../../css/forms.min.css"/>
  <link rel="stylesheet" href="../../css/style.css"/>
</head>
<body ng-controller="inventCtrl">
<nav class="navbar navbar-inverse navbar-fixed-top to-nav">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
      </button>
      <a class="navbar-brand to-brand" href="#"><i class="fa fa-weixin fa-fw"></i>&nbsp;&nbsp;SZG 后台管理系统</a>
    </div>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav navbar-right">
        <li class="dropdown">
          <a href="javascript:" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
            <i class="fa fa-gear"></i>&nbsp;Mr Toma&nbsp;<span class="caret"></span>
          </a>
          <ul class="dropdown-menu">
            <li><a href="#">个人信息</a></li>
            <li><a href="#">修改密码</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">退出系统</a></li>
          </ul>
        </li>
      </ul>
    </div><!-- navbar-collapse -->
  </div>
</nav>
<!-- 菜单 start -->
<aside class="sidebar_left">
  <div class="sidebar_content">
    <ul class="nav">
      <li class="active">
        <a href="#" class="nav-link"><i class="fa fa-group"></i>产品管理</a>
        <ul class="link-lop">
          <li><a href="javascript:">周边游</a></li>
          <li><a href="javascript:">国内游</a></li>
          <li><a href="javascript:">出境游</a></li>
          <li><a href="javascript:">赴台游</a></li>
        </ul>
      </li>
      <li><a href="#" class="nav-link"><i class="fa fa-wrench"></i>网站设置</a></li>
    </ul>
  </div>
</aside>
<!-- 菜单 end -->
<section class="content">
  <div class="con-wap">
    <!-- view start -->

    <ol class="breadcrumb border">
      <li><a href="#">产品管理</a></li>
      <li><a href="#">周边游</a></li>
      <li class="active">新增周边游</li>
    </ol>

    <article class="panel panel-default">
      <header class="panel-heading">
        <button type="button" class="btn btn-default">新增价格/库存</button>
        <button type="button" class="btn btn-default">批量修改价格</button>
        <button type="button" class="btn btn-default">批量修改库存</button>
        <button type="button" class="btn btn-default">批量上架</button>
        <button type="button" class="btn btn-default">批量下架</button>
        <button type="button" class="btn btn-default">批量成团</button>
      </header>
      <section class="panel-body">
        <!-- 月份导航 start -->
        <ul class="app-inventory-nav">
          <li><a href class="fa fa-arrow-left"></a></li>
          <li ng-repeat="k in monthLink" ng-class="{'active': k == month}">
            <span ng-bind="year" ng-show="k == 1"></span>
            <a href ng-bind="k"></a>
          </li>
          <li><a href class="fa fa-arrow-right"></a></li>
        </ul>
        <!-- 月份导航 end -->
      </section>
      <table class="table table-bordered invent-table">
        <thead>
          <tr>
            <th>
              <span ng-bind="year"></span>
              <h1 class="no-m text-theme" ng-bind="month"></h1>
            </th>
            <th ng-repeat="w in weekName" ng-bind="w"></th>
          </tr>
        </thead>
        <tbody ng-repeat="t in tableCol">
          <!-- 日期 -->
          <tr>
            <td rowspan="2"></td>
            <td class="bg-glow" ng-repeat="r in t" ng-bind="r.i" ng-class="{'text-gray':r.dis}"></td>
          </tr>
          <!-- 操作栏 -->
          <tr>
            <td ng-repeat="r in t">
              <div ng-if="r.de">
                <div ng-hide="r.edit">
                  <label class="badge-btn">
                    <small class="text-theme" ng-show="day[r.id].sj">销售中 </small>
                    <small class="text-theme" ng-hide="day[r.id].sj">已下架 </small>
                    <input type="checkbox" name="day[{{r.id}}][sj]" ng-model="day[r.id].sj" ng-change="ity.sj(r.id,day[r.id].sj)">
                    <span ng-show="day[r.id].sj">下架</span>
                    <span ng-hide="day[r.id].sj">上架</span>
                  </label>
                  <label class="badge-btn" ng-hide="day[r.id].sj" ng-click="r.edit=true"><span>修改</span></label>
                </div>
                <div ng-show="r.edit">
                  <label class="badge-btn theme-btn" ng-click="ity.save(day[r.id]);r.edit=false;"><span>保存</span></label>
                  <label class="badge-btn" ng-click="ity.reset(r.id);r.edit=false"><span>取消</span></label>
                </div>
              </div>
            </td>
          </tr>
          <!-- 儿童价格 -->
          <tr>
            <td>儿童价格</td>
            <td ng-repeat="r in t" ng-class="{'bg-e4':!day[r.id].sj && !r.edit && r.de}">
              <div ng-if="r.de">
                <div ng-hide="r.edit">
                  <div class="displayt w100b">
                    <span class="cell text-left">卖：</span>
                    <span class="cell text-right" ng-bind="day[r.id].etj.m"></span>
                  </div>
                  <div class="displayt w100b">
                    <span class="cell text-left">结：</span>
                    <span class="cell text-right" ng-bind="day[r.id].etj.c"></span>
                  </div>
                </div>
                <div ng-show="r.edit">
                  <div class="input-group mb10">
                    <span class="input-group-addon">卖</span>
                    <input type="number" class="form-control" placeholder="买" name="day[{{r.id}}][etj][m]" ng-model="day[r.id].etj.m">
                  </div>
                  <div class="input-group">
                    <span class="input-group-addon">结</span>
                    <input type="number" class="form-control" placeholder="结" name="day[{{r.id}}][etj][c]" ng-model="day[r.id].etj.c">
                  </div>
                </div>
              </div>
            </td>
          </tr>

          <tr>
            <td>成人价</td>
            <td ng-repeat="r in t" ng-class="{'bg-e4':!day[r.id].sj && !r.edit && r.de}">
              <div ng-if="r.de">
                <div ng-hide="r.edit">
                  <div class="displayt w100b">
                    <span class="cell text-left">卖：</span>
                    <span class="cell text-right" ng-bind="day[r.id].crj.m"></span>
                  </div>
                  <div class="displayt w100b">
                    <span class="cell text-left">结：</span>
                    <span class="cell text-right" ng-bind="day[r.id].crj.c"></span>
                  </div>
                </div>
                <div ng-show="r.edit">
                  <div class="input-group mb10">
                    <span class="input-group-addon">卖</span>
                    <input type="number" class="form-control" placeholder="买" name="day[{{r.id}}][crj][m]" ng-model="day[r.id].crj.m">
                  </div>
                  <div class="input-group">
                    <span class="input-group-addon">结</span>
                    <input type="number" class="form-control" placeholder="结" name="day[{{r.id}}][crj][c]" ng-model="day[r.id].crj.c">
                  </div>
                </div>
              </div>
            </td>
          </tr>

          <tr>
            <td>个人补差价</td>
            <td ng-repeat="r in t" ng-class="{'bg-e4':!day[r.id].sj && !r.edit && r.de}">
              <div ng-if="r.de">
                <div ng-hide="r.edit">
                  <div class="displayt w100b">
                    <span class="cell text-left">结：</span>
                    <span class="cell text-right" ng-bind="day[r.id].bcj.c"></span>
                  </div>
                </div>
                <div ng-show="r.edit">
                  <div class="input-group">
                    <span class="input-group-addon">结</span>
                    <input type="number" class="form-control" placeholder="结" name="day[{{r.id}}][bcj][c]" ng-model="day[r.id].bcj.c">
                  </div>
                </div>
              </div>
            </td>
          </tr>

          <tr>
            <td>库存</td>
            <td ng-repeat="r in t" ng-class="{'bg-e4':!day[r.id].sj && !r.edit && r.de}">
              <div ng-if="r.de">
                <div ng-hide="r.edit">
                  <div class="displayt w100b">
                    <span class="cell text-left">计划：</span>
                    <span class="cell text-right" ng-bind="day[r.id].kc.jh"></span>
                  </div>
                  <div class="displayt w100b">
                    <span class="cell text-left">已收：</span>
                    <span class="cell text-right" ng-bind="day[r.id].kc.ys"></span>
                  </div>
                  <div class="displayt w100b">
                    <span class="cell text-left">剩余：</span>
                    <span class="cell text-right" ng-bind="day[r.id].kc.sy"></span>
                  </div>
                </div>
                <div ng-show="r.edit">
                  <div class="input-group">
                    <span class="input-group-btn">
                      <button class="btn btn-default" type="button" ng-mousedown="ity.kcSub(r.id)">-</button>
                    </span>
                      <input type="number" class="form-control text-center" value="0" name="day[{{r.id}}][kc][jh]" ng-model="day[r.id].kc.jh">
                    <span class="input-group-btn">
                      <button class="btn btn-default" type="button" ng-mousedown="ity.kcAdd(r.id)">+</button>
                    </span>
                  </div>
                </div>

              </div>
            </td>
          </tr>

          <tr>
            <td>成团操作</td>
            <td ng-repeat="r in t">
              <div ng-if="r.de">
                <div ng-hide="day[r.id].ct">
                  <p>未成团</p>
                  <a href ng-click="ity.chengt(r.id)">点击成团</a>
                </div>
                <div ng-show="day[r.id].ct">
                  <p>已成团</p>
                  <a class="text-warning" href="{{day[r.id].cthref}}">出团通知书</a>
                </div>
              </div>
            </td>
          </tr>
        </tbody>
      </table>
      <footer class="panel-footer text-right">
        <button type="button" class="btn btn-default btn-lg w120">返回</button>
        <button type="button" class="btn btn-warning btn-lg w120">保存</button>
      </footer>

    </article>

    <div class="h360"></div>
    <!-- view end -->
  </div>
</section>

<script src="../../lib/angular.min.js"></script>
<script src="../../lib/jquery.min.js"></script>
<script src="../../js/sea.js"></script>
<script src="../../js/main.js"></script>
<script>

  window.data = {
    time: '2016/7/18',
    days: {
      "2016/7/1": {
        "sj": true,
        "ct": true,
        "cthref":'www.cc.com',
        "crj": {
          "m": 5000,
          "c": 150
        },
        "etj": {
          "m": 300,
          "c": 1050
        },
        "bcj": {
          "c": 1050
        },
        "kc": {
          "jh": 1300,
          "ys": 100,
          "sy": 130
        }
      },
      "2016/7/10": {
        "sj": true,
        "ct": false,
        "crj": {
          "m": 5000,
          "c": 150
        },
        "etj": {
          "m": 300,
          "c": 450
        },
        "bcj": {
          "c": 1050
        },
        "kc": {
          "jh": 1300,
          "ys": 100,
          "sy": 130
        }
      },
      "2016/7/11": {
        "sj": false,
        "ct": false,
        "crj": {
          "m": 5000,
          "c": 150
        },
        "etj": {
          "m": 300,
          "c": 450
        },
        "bcj": {
          "c": 1050
        },
        "kc": {
          "jh": 1300,
          "ys": 100,
          "sy": 130
        }
      },
      "2016/7/18": {
        "sj": false,
        "ct": false,
        "crj": {
          "m": 5000,
          "c": 150
        },
        "etj": {
          "m": 300,
          "c": 30
        },
        "bcj": {
          "c": 1050
        },
        "kc": {
          "jh": 1300,
          "ys": 100,
          "sy": 130
        }
      }
    }
  }
 seajs.use('inventory');
</script>
</body>
</html>